package com.itstyle.quartz.config;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletResponse;

/**
 * @author 张霄峰
 * @email 29839415@qq.com
 * @date 2020/4/14 13:24
 */
@Controller
public class IndexController {
	
	/**
	 * 页面跳转
	 * @param module
	 * @param url
	 * @return
	 */
	@RequestMapping("{url}.shtml")
	public String page(@PathVariable("url") String url, HttpServletResponse response) {
		response.setHeader("X-Frame-Options", "SAMEORIGIN");// 解决IFrame拒绝的问题
		return  url;
	}
	/**
	 * 页面跳转(二级目录)
	 * @param module
	 * @param function
	 * @param url
	 * @return
	 */
	@RequestMapping("{module}/{url}.shtml")
	public String page(@PathVariable("module") String module,@PathVariable("url") String url, HttpServletResponse response) {
		response.setHeader("X-Frame-Options", "SAMEORIGIN");// 解决IFrame拒绝的问题
		return module + "/" + url;
	}
	
}
